package demo12;

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int[] arr = new int[100];
        int size = 0;
        for(int i = 2; i < num; i++) {
            int j = 0;
            for(j = 2; j <= i; j++) {
                if(i % j == 0) {
                    break;
                }
            }
            if(i == j) {
                arr[size] = i;
                size++;
            }
        }
        int min = 0;
        int count = 0;
        int z = 0;
        int[] arr2 = new int[size];
        for(int i = 0; i < size; i++) {
            for(int j = i; j < size; j++) {
                if(arr[i] + arr[j] == num) {
                   count++;

                   arr2[z] = arr[i];
                   arr2[z+1] = arr[j];
                   z+=2;

                }
            }
        }
        int a = 0;
        int b = 0;
        for(int i = 0; i < z; i+=2) {
            min = arr2[i+1] - arr2[i];
            if(min > arr2[i+1] - arr2[i]) {
                min = arr2[i+1] - arr2[i];
            }
            a = arr2[i];
            b = arr2[i+1];
            }
        System.out.println(a);
        System.out.println(b);

        }

    }